<?php
require('config.php');

        $user_id=$_REQUEST['user_id'];
        //$user_id=54;
        //$orderId=124;
		$sql="select * from `".$oto."_orders`,`".$oto."_order_goods`,`".$oto."_shops` where ".$oto."_orders.userId='".$user_id."' and `orderFlag`='1' and ".$oto."_orders.orderId=".$oto."_order_goods.orderId and ".$oto."_shops.shopId=".$oto."_orders.shopId and ".$oto."_orders.orderStatus='4'";
		//echo $sql;
		//die();
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$person_info[]=$row;//将取得的所有数据赋值给person_info数组
		}
		for($i=0;$i<count($person_info);$i++)
		{
			$goods_id=$person_info[$i]['goodsId'];
			$order_id=$person_info[$i]['orderId'];
			$sql="select * from `".$oto."_goods_appraises` where orderId='{$order_id}' and goodsId='{$goods_id}' and userId='{$user_id}'";
			$result=$db->query($sql);
			while($row=$result->fetch_assoc()){
				$pingjia_info[$i]=$row;//将取得的所有数据赋值给person_info数组
			}
			if(!isset($pingjia_info[$i]))
			{
				$data[]=$person_info[$i];
			}
		}
		echo json_encode($data);
?>